#pragma once
#include<string>
using namespace std;
class PF_Item{
public:
    enum ItemState{
        AVAILABLE,
        PICKED,
        BANNED,
        ASSIGNED
    };
private:
    //height 16 bits for role, low 16 bits for profession
    int ID;

    // Indicates whether the item is available
    bool isAvailable;

    ItemState state;
    int assignID; // ID of the player who chose the item(relative to the team)
    int teamID; // ID of the team that picked the item or set the item as unavailable
public:
    PF_Item(){
        ID=-1;
        isAvailable=true;
        assignID=-1;
        teamID=-1;
        ItemState state=AVAILABLE;
    }

    PF_Item(int id, bool available){
        ID=id;
        isAvailable=available;
        assignID=-1;
        teamID=-1;
        ItemState state=AVAILABLE;
    }

    int getPickerID(){
        return assignID;
    }

    void setPickerID(int assignID){
        this->assignID=assignID;
    }

    int getTeamID(){
        return teamID;
    }

    void setTeamID(int teamID){
        this->teamID=teamID;
    }

    int getID(){
        return ID;
    }

    void setID(int id){
        ID=id;
    }

    bool getisAvailable(){
        return isAvailable;
    }

    void setAvailable(bool available){
        isAvailable=available;
    }

    void setItemState(ItemState state){
        this->state=state;
    }

    ItemState getItemState(){
        return state;
    }

    // Returns 0 if successful, 1 if invalid role or profession
    int Picked(int teamID, int assignID);


    string toString();
};